package com.example.behaviour.visitor.simple;

/**
 * @Author douhy
 * @description 测试类
 * dog.eat()方法参数为 未实现的接口，调用方法时对参数进行实例化 实现自己逻辑
 * @date 22/01/14
 */
public class Client {
    public static void main(String[] args) {
        Dog dog = new Dog();
        // 匿名内部类
        dog.eat(new Eat() {
            @Override
            public String eatFood() {
              return "月饼";
            }
        });

        // lambda
        dog.eat(()->{   return "葡萄";});
    }
}
